package net.starwifi.duobao.websocket;



//@ServerEndpoint("/websocket/ws")
public class OperatorWebSocket {

/*
    *//** 客户端池 *//*
    public static Map<String,Session> sessionCache=new ConcurrentHashMap<String,Session>();

    *//** 常规命令区 *//*
    public Map<String,LinkedBlockingQueue<WSMessage>> msgCache=new ConcurrentHashMap<String,LinkedBlockingQueue<WSMessage>>();

    *//** 当前session *//*
    private Session session;

    @OnOpen
    public void onOpen(Session session){
        this.session=session;
        sessionCache.put(session.getId(), session);
        try {
            session.getBasicRemote().sendText("连接成功");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @OnClose
    public void onClose(){
        sessionCache.remove(session.getId());
    }

    @OnMessage
    public void onMessage(String message,Session session){
        System.out.printf("接收到客户端消息:" + message);
    }

    *//**
     * 发生错误时调用
     * @param session
     * @param error
     *//*
    @OnError
    public void onError(Session session, Throwable error){
        System.out.println("发生错误");
        error.printStackTrace();
    }*/

}
